export class PlanetType {
    id = 0
    name = ''
    type = '热带'
    wind = 0
    land = 0
    oceanId = 0
}

export let planetTypeData: Array<PlanetType> = []
export let hotPlanetTypeData: Array<PlanetType> = []
export let warmPlanetTypeData: Array<PlanetType> = []
export let coldPlanetTypeData: Array<PlanetType> = []

export let gasPlanetTypeData: Array<PlanetType> = []

export let planetTypeMap = new Map<number, PlanetType>()

export let planetTypeIdNameMap = new Map<number, String>()

export let loadPlanetTypeData = () => {
    for (let i of defaultData) {
        planetTypeData.push(Object.assign(new PlanetType(), i))
        if ('巨行星' === i.type) {
            gasPlanetTypeData.push(Object.assign(new PlanetType(), i))
        } else if ('温带' === i.type) {
            warmPlanetTypeData.push(Object.assign(new PlanetType(), i))
        } else if ('寒带' === i.type) {
            coldPlanetTypeData.push(Object.assign(new PlanetType(), i))
        } else {
            hotPlanetTypeData.push(Object.assign(new PlanetType(), i))
        }
    }
    for (let planet of planetTypeData) {
        planetTypeMap.set(planet.id, planet)
        planetTypeIdNameMap.set(planet.id, planet.name)
    }
}

let defaultData: Array<any> = [
    {
        id: 1,
        name: '地中海',
        type: '温带',
        wind: 1,
        land: 0.6,
        oceanId: 1
    }, {
        id: 2,
        name: '干旱荒漠',
        wind: 1.5,
        land: 1
    }, {
        id: 3,
        name: '灰烬冻土',
        type: '寒带',
        wind: 0.4,
        land: 1
    }, {
        id: 4,
        name: '海洋丛林',
        type: '温带',
        wind: 1,
        land: 0.5,
        oceanId: 1
    }, {
        id: 5,
        name: '熔岩',
        wind: 0.7,
        land: 0.85,
        oceanId: 3
    }, {
        id: 6,
        name: '冰原冻土',
        type: '寒带',
        wind: 0.7,
        land: 0.98
    }, {
        id: 7,
        name: '贫瘠荒漠',
        wind: 0,
        land: 1
    }, {
        id: 8,
        name: '戈壁',
        wind: 0.8,
        land: 0.98
    }, {
        id: 9,
        name: '火山灰',
        wind: 0.8,
        land: 0.98,
        oceanId: 2
    }, {
        id: 10,
        name: '红石',
        type: '温带',
        wind: 1,
        land: 0.6,
        oceanId: 1
    }, {
        id: 11,
        name: '草原',
        type: '温带',
        wind: 1,
        land: 0.85,
        oceanId: 1
    }, {
        id: 12,
        name: '水世界',
        type: '温带',
        wind: 1.1,
        land: 0.01,
        oceanId: 1
    }, {
        id: 13,
        name: '黑石焦滩',
        wind: 1.1,
        land: 1
    }, {
        id: 14,
        name: '樱林海',
        type: '温带',
        wind: 1,
        land: 0.65,
        oceanId: 1
    }, {
        id: 15,
        name: '飓风石林',
        type: '寒带',
        wind: 1.6,
        land: 1
    }, {
        id: 16,
        name: '猩红冰湖',
        type: '寒带',
        wind: 0.7,
        land: 0.7
    }, {
        id: 17,
        name: '热带草原',
        type: '温带',
        wind: 1.1,
        land: 0.92,
        oceanId: 1
    }, {
        id: 18,
        name: '橙晶荒漠',
        type: '温带',
        wind: 1.5,
        land: 0.98
    }, {
        id: 19,
        name: '极寒冻土',
        type: '寒带',
        wind: 1.3,
        land: 1
    }, {
        id: 20,
        name: '潘多拉沼泽',
        type: '温带',
        wind: 1,
        land: 1
    }, {
        id: 21,
        name: '气巨',
        type: '巨行星'
    }, {
        id: 22,
        name: '冰巨',
        type: '巨行星'
    }
]